import { AutoService, query, queryOne, insert, execute } from './autoRoute';

// 🌍 全局注入数据库操作函数和AutoService
declare global {
  var AutoService: any;
  var query: (sql: string, params?: any[]) => Promise<any[]>;
  var queryOne: <T = any>(sql: string, params?: any[]) => Promise<T | null>;
  var insert: (sql: string, params?: any[]) => Promise<any>;
  var execute: (sql: string, params?: any[]) => Promise<any>;
}

// 注入到全局
(global as any).AutoService = AutoService;
(global as any).query = query;
(global as any).queryOne = queryOne;
(global as any).insert = insert;
(global as any).execute = execute;

console.log('🌍 全局函数注入完成');

export {}; 